﻿@model Mvc.Models.UserProfile

@{
    ViewBag.Title = "Usuarios > Edit";
    var options = new AjaxOptions()
                      {
                          Url = Url.Action("Edit", "Account"),
                          LoadingElementId = "",
                          UpdateTargetId ="content",
                          InsertionMode = InsertionMode.Replace, // <-- Replace the content of DOM element
                          HttpMethod = "POST",
                         
                         
                      };  
}


<h2>Edit</h2>

 @using (Ajax.BeginForm(options)) 
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Menu</legend>

        @Html.HiddenFor(model => model.UserId)

        <div class="editor-label">
            @Html.LabelFor(model => model.UserName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.UserName)
            @Html.ValidationMessageFor(model => model.UserName)
        </div>
       

        <div class="editor-label">
            @Html.LabelFor(model => model.Email)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Email)
            @Html.ValidationMessageFor(model => model.Email)
        </div>
<div class="editor-label">
            @Html.LabelFor(model => model.GroupId, "Grupo")
        </div>
        <div class="editor-field">
            @Html.DropDownList("GroupId", String.Empty)
            @Html.ValidationMessageFor(model => model.GroupId)
        </div>       
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

